//using System.Runtime.InteropServices;

namespace Stetson.Emulator {
	public class Parallel  {

		#region Dll Imports

		//[DllImport("inpout32.dll", EntryPoint = "Inp32")]
		//static extern int Input(int address);

		//[DllImport("inpout32.dll", EntryPoint = "Out32")]
		//static extern int Output(int address, int value);

		#endregion

		private int currentState = 0xFF;

		#region Properties

		private int baseAddress;
		public int BaseAddress {
			get { return this.baseAddress; }
			set { this.baseAddress = value; }
		}

		#endregion

		#region Constructors

		public Parallel(int address) {
			this.baseAddress = address;
		}

		public Parallel()
			: this(0x378) {
		}

		#endregion

		#region Data Lines

		public bool D0 {
			get {
				return false;//(Input(this.BaseAddress + 1) & 0x20) != 0;
			}
			set {
				if (value) currentState |= 1; else currentState &= ~1;
				//Output(this.BaseAddress, currentState);
			}
		}

		public bool D1 {
			get {
				return false;//(Input(this.BaseAddress + 1) & 0x10) != 0;
			}
			set {
				if (value) currentState |= 2; else currentState &= ~2;
				//Output(this.BaseAddress, currentState);
			}
		}

		#endregion

	}
}
